package com.aac.rabbitapi.consumer;

import com.aac.rabbitapi.constant.Queues;
import lombok.Getter;
import lombok.Setter;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
@RabbitListener(queues = {Queues.RESPONSE_QUEUE + 1, Queues.RESPONSE_QUEUE + 2,
                Queues.RESPONSE_QUEUE + 3, Queues.RESPONSE_QUEUE + 4, Queues.RESPONSE_QUEUE + 5})
public class ResponseMapConsumer {

    @Getter
    @Setter
    private Map<String, Object> responseMap;

    @RabbitHandler
    public void listenResponseMap(Map<String, Object> responseMap) {
        setResponseMap(responseMap);
    }

}
